/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controlador;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author User
 */
public class ConnectionFactory {

    private static ConnectionFactory connectionFactory;
    private EntityManagerFactory factory;

    public ConnectionFactory() {
    }

    public static ConnectionFactory getFactory() { //Patron Singleton
        if (connectionFactory == null) {
            connectionFactory = new ConnectionFactory();
            connectionFactory.setFactory();
        }
        return connectionFactory;
    }

    public void setFactory() {
        factory = Persistence.createEntityManagerFactory("ProyectoDSIIPU");
    }

    public EntityManagerFactory getFactoria() {
        return factory;
    }
}
